// pages/yiliangfang/upkeep.js
Page({
  data: {
    scrollviewheight: '',
    ci_rwdid: '',
    showView: true,
    showView2: true,
    showView3: true,
    showView4: true,
    showView5: true,
    showView6: true,
    ca_ReqConTime: '',            //施工时间
    ca_ProductProtection: '',     //公共区域保护
    ca_PropertyInsurance: '',     //工程一切险要求
    ca_DesignatedFireCompany: '', //指定消防公司 int
    ca_DesignatedAirCompany: '',  //指定空调公司 int
    ca_DesignatedSinotrans: '',   //指定垃圾外运 int

    index1: 0,
    index2: 0,
    index3: 0,
    index4: 0,
    index5: 0,
    index6: 0,
    arraylist1: ['白天', '晚上', '均可'],
    arraylist2: ['是', '否'],
    arraylist3: ['是', '否'],
    arraylist4: ['是', '否'],
    arraylist5: ['是', '否'],
    arraylist6: ['是', '否'],
  },
  onLoad: function (options) {
    var that = this
    var ci_rwdid = options.ci_rwdid
    that.setData({
      ci_rwdid: options.ci_rwdid,
    })
    // 数据请求接口一
    that.requestData(that.data.ci_rwdid)
  },

  //提交数据
  requestData: function (ci_rwdid) {
    var that = this

    wx.request({
      url: 'https://api.wenes.cn/JD/GetPropertyInfo?ci_rwdid=' + that.data.ci_rwdid,
      success: function (res) {
        console.log(res.data.Table)
        var item = res.data.Table[0]
        that.setData({
          WorksID: item.WorksID,
          CustomerID: item.CustomerID,
          ca_ReqConTime: item.ca_ReqConTime,
          ca_ProductProtection: item.ca_ProductProtection,
          ca_PropertyInsurance: item.ca_PropertyInsurance,
          ca_DesignatedFireCompany: item.ca_DesignatedFireCompany,
          ca_DesignatedAirCompany: item.ca_DesignatedAirCompany,
          ca_DesignatedSinotrans: item.ca_DesignatedSinotrans,
        })
      }
    })
  },

  // 页面跳转
  measureroom: function () {
    var that = this
    wx.redirectTo({
      url: 'measureroom?ci_rwdid=' + that.data.ci_rwdid,
    })
  },
  surroundings: function () {
    var that = this
    wx.redirectTo({
      url: 'surroundings?ci_rwdid=' + that.data.ci_rwdid + '&WorksID=' + that.data.WorksID + '&CustomerID=' + that.data.CustomerID,
    })
  },
  demand: function () {
    var that = this
    wx.redirectTo({
      url: 'demand?ci_rwdid=' + that.data.ci_rwdid,
    })
  },


})